package com.testmall.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.testmall.entity.common.PageBean;
import com.testmall.utils.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.testmall.entity.Shopping;
import com.testmall.mapper.ShoppingMapper;
import com.testmall.service.ShoppingService;
/**
  * @Description: 
  * @Author: littleDesire
  * @Date: 2022-06-21 14:29
  * @Version: 1.0
  * 
  */
@Service
public class ShoppingServiceImpl extends ServiceImpl<ShoppingMapper, Shopping> implements ShoppingService{

    @Autowired
    ShoppingMapper shoppingMapper;

    @Override
    public PageBean querypage(Map map) {
        PageHelper.startPage(MapUtils.getPageNumValue(map),MapUtils.getPageSizeValue(map));
        List list=shoppingMapper.query(map);
        Page page= (Page) list;
        return new PageBean(page.getPageNum(),page.getPageSize(),page.getTotal(),page.getPages(),list);
    }
}
